package site.wanjiahao.heap;

import java.util.Comparator;

public abstract class AbstractHeap<E> implements Heap<E>{

    protected int size;

    protected static final int DEFAULT_CAPACITY = 10;

    protected Comparator<E> comparator;

    public AbstractHeap() {
        this(null);
    }

    public AbstractHeap(Comparator<E> comparator) {
        this.comparator = comparator;
    }

    @Override
    public int size() {
        return size;
    }

    @Override
    public boolean isEmpty() {
        return size == 0;
    }
}
